<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header"><?= $navName ?></div>
        <div class="layui-card-body">
            <form id="addFrm" class="layui-form" action="" lay-filter="component-form-group">
                <input type="hidden" name="id" value="<?= !empty($editData['id']) ? $editData['id'] : 0; ?>">
                <div class="layui-form-item">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="truename" value="<?= !empty($editData['truename']) ? $editData['truename'] : ""; ?>" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">用户名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="username" value="<?= !empty($editData['username']) ? $editData['username'] : ""; ?>" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-inline">
                        <input type="password" name="password" value="" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">后台角色</label>
                    <div class="layui-input-inline">
                        <select name="role_id">
                            <option value="0">无权限</option>
                            <?php foreach ($adminRole as $k => $v) { ?>
                                <option value="<?= $v["id"] ?>"<?= !empty($editData["role_id"]) && $editData["role_id"] == $v["id"] ? " selected" : "" ?>><?= $v["name"] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea name="remark" placeholder="" class="layui-textarea" style="width:500px"><?= !empty($editData['remark']) ? $editData['remark'] : "" ?></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <?php
                        foreach ($status as $k => $v) {
                            ?>
                            <input type="radio" name="status_id" value="<?= $v["id"] ?>"<?= !empty($editData) && $editData['status_id'] == $v["id"] ? " checked" : ($v["id"] == 1 && !isset($editData['status_id']) ? " checked" : "") ?> title="<?= $v["name"] ?>">
                        <?php } ?>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn customize" lay-filter="formDemo" id="submitBtn">确定提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    var doAddUrl = "<?= $ajaxAddUrl ?>";
    var listUrl = "<?= $this->projectUrl["list"] ?>";
</script>
<script src="<?= PUBLIC_URL . "/admin/js/adminUser/add.js?" . rand() ?>"></script>
